update
This commit is contained in:
108
tool-tech-admin/src/main/resources/mapper/DocumentMapper.xml
Normal file
108
tool-tech-admin/src/main/resources/mapper/DocumentMapper.xml
Normal file
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.rzdata.web.mapper.DocumentMapper">
|
||||
|
||||
<resultMap type="Document" id="DocumentResult">
|
||||
<result property="docId" column="doc_id" />
|
||||
<result property="docCode" column="doc_code" />
|
||||
<result property="docName" column="doc_name" />
|
||||
<result property="docType" column="doc_type" />
|
||||
<result property="docPrincipals" column="doc_principals" />
|
||||
<result property="docRespDept" column="doc_resp_dept" />
|
||||
<result property="docSource" column="doc_source" />
|
||||
<result property="docStatus" column="doc_status" />
|
||||
<result property="docUrl" column="doc_url" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDocumentVo">
|
||||
select doc_id, doc_code, doc_name, doc_type, doc_principals, doc_resp_dept, doc_source, doc_status, doc_url, create_by, create_time, update_by, update_time from t_document
|
||||
</sql>
|
||||
|
||||
<select id="selectDocumentList" parameterType="Document" resultMap="DocumentResult">
|
||||
<include refid="selectDocumentVo"/>
|
||||
<where>
|
||||
<if test="docCode != null and docCode != ''"> and doc_code = #{docCode}</if>
|
||||
<if test="docName != null and docName != ''"> and doc_name like concat('%', #{docName}, '%')</if>
|
||||
<if test="docType != null and docType != ''"> and doc_type = #{docType}</if>
|
||||
<if test="docPrincipals != null and docPrincipals != ''"> and doc_principals = #{docPrincipals}</if>
|
||||
<if test="docRespDept != null and docRespDept != ''"> and doc_resp_dept = #{docRespDept}</if>
|
||||
<if test="docSource != null and docSource != ''"> and doc_source = #{docSource}</if>
|
||||
<if test="docStatus != null and docStatus != ''"> and doc_status = #{docStatus}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDocumentById" parameterType="String" resultMap="DocumentResult">
|
||||
<include refid="selectDocumentVo"/>
|
||||
where doc_id = #{docId}
|
||||
</select>
|
||||
|
||||
<insert id="insertDocument" parameterType="Document">
|
||||
insert into t_document
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="docId != null">doc_id,</if>
|
||||
<if test="docCode != null">doc_code,</if>
|
||||
<if test="docName != null">doc_name,</if>
|
||||
<if test="docType != null">doc_type,</if>
|
||||
<if test="docPrincipals != null">doc_principals,</if>
|
||||
<if test="docRespDept != null">doc_resp_dept,</if>
|
||||
<if test="docSource != null">doc_source,</if>
|
||||
<if test="docStatus != null">doc_status,</if>
|
||||
<if test="docUrl != null">doc_url,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="docId != null">#{docId},</if>
|
||||
<if test="docCode != null">#{docCode},</if>
|
||||
<if test="docName != null">#{docName},</if>
|
||||
<if test="docType != null">#{docType},</if>
|
||||
<if test="docPrincipals != null">#{docPrincipals},</if>
|
||||
<if test="docRespDept != null">#{docRespDept},</if>
|
||||
<if test="docSource != null">#{docSource},</if>
|
||||
<if test="docStatus != null">#{docStatus},</if>
|
||||
<if test="docUrl != null">#{docUrl},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDocument" parameterType="Document">
|
||||
update t_document
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="docCode != null">doc_code = #{docCode},</if>
|
||||
<if test="docName != null">doc_name = #{docName},</if>
|
||||
<if test="docType != null">doc_type = #{docType},</if>
|
||||
<if test="docPrincipals != null">doc_principals = #{docPrincipals},</if>
|
||||
<if test="docRespDept != null">doc_resp_dept = #{docRespDept},</if>
|
||||
<if test="docSource != null">doc_source = #{docSource},</if>
|
||||
<if test="docStatus != null">doc_status = #{docStatus},</if>
|
||||
<if test="docUrl != null">doc_url = #{docUrl},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where doc_id = #{docId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDocumentById" parameterType="Long">
|
||||
delete from t_document where doc_id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDocumentByIds" parameterType="String">
|
||||
delete from t_document where doc_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
157
tool-tech-admin/src/main/resources/mapper/ToolMapper.xml
Normal file
157
tool-tech-admin/src/main/resources/mapper/ToolMapper.xml
Normal file
@@ -0,0 +1,157 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.rzdata.web.mapper.ToolMapper">
|
||||
|
||||
<resultMap type="Tool" id="ToolResult">
|
||||
<result property="toolId" column="tool_id" />
|
||||
<result property="toolCode" column="tool_code" />
|
||||
<result property="toolName" column="tool_name" />
|
||||
<result property="toolType" column="tool_type" />
|
||||
<result property="toolSource" column="tool_source" />
|
||||
<result property="toolUse" column="tool_use" />
|
||||
<result property="testSituation" column="test_situation" />
|
||||
<result property="functionDesc" column="function_desc" />
|
||||
<result property="applyCondition" column="apply_condition" />
|
||||
<result property="operateExplain" column="operate_explain" />
|
||||
<result property="toolPrincipals" column="tool_principals" />
|
||||
<result property="toolPrincipalsName" column="tool_principals_name" />
|
||||
<result property="toolRespDept" column="tool_resp_dept" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<association property="dept" javaType="SysDept" resultMap="deptResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="deptResult" type="SysDept">
|
||||
<id property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="leader" column="leader" />
|
||||
<result property="status" column="dept_status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectToolVo">
|
||||
select tool_id, tool_code, tool_name, tool_type, tool_source, tool_use, test_situation, function_desc, apply_condition, operate_explain, tool_principals, tool_principals_name, tool_resp_dept, status, remark, create_by, create_time, update_by, update_time from t_tool
|
||||
</sql>
|
||||
|
||||
<select id="selectToolByToolId" parameterType="String" resultMap="ToolResult">
|
||||
<include refid="selectToolVo"/>
|
||||
where tool_id = #{toolId}
|
||||
</select>
|
||||
|
||||
<insert id="insertTool" parameterType="Tool">
|
||||
insert into t_tool
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="toolId != null">tool_id,</if>
|
||||
<if test="toolCode != null">tool_code,</if>
|
||||
<if test="toolName != null">tool_name,</if>
|
||||
<if test="toolType != null">tool_type,</if>
|
||||
<if test="toolSource != null">tool_source,</if>
|
||||
<if test="toolUse != null">tool_use,</if>
|
||||
<if test="testSituation != null">test_situation,</if>
|
||||
<if test="functionDesc != null">function_desc,</if>
|
||||
<if test="applyCondition != null">apply_condition,</if>
|
||||
<if test="operateExplain != null">operate_explain,</if>
|
||||
<if test="toolPrincipals != null">tool_principals,</if>
|
||||
<if test="toolPrincipalsName != null">tool_principals_name,</if>
|
||||
<if test="toolRespDept != null">tool_resp_dept,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="toolId != null">#{toolId},</if>
|
||||
<if test="toolCode != null">#{toolCode},</if>
|
||||
<if test="toolName != null">#{toolName},</if>
|
||||
<if test="toolType != null">#{toolType},</if>
|
||||
<if test="toolSource != null">#{toolSource},</if>
|
||||
<if test="toolUse != null">#{toolUse},</if>
|
||||
<if test="testSituation != null">#{testSituation},</if>
|
||||
<if test="functionDesc != null">#{functionDesc},</if>
|
||||
<if test="applyCondition != null">#{applyCondition},</if>
|
||||
<if test="operateExplain != null">#{operateExplain},</if>
|
||||
<if test="toolPrincipals != null">#{toolPrincipals},</if>
|
||||
<if test="toolPrincipalsName != null">#{toolPrincipalsName},</if>
|
||||
<if test="toolRespDept != null">#{toolRespDept},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTool" parameterType="Tool">
|
||||
update t_tool
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="toolName != null">tool_name = #{toolName},</if>
|
||||
<if test="toolType != null">tool_type = #{toolType},</if>
|
||||
<if test="toolSource != null">tool_source = #{toolSource},</if>
|
||||
<if test="toolUse != null">tool_use = #{toolUse},</if>
|
||||
<if test="testSituation != null">test_situation = #{testSituation},</if>
|
||||
<if test="functionDesc != null">function_desc = #{functionDesc},</if>
|
||||
<if test="applyCondition != null">apply_condition = #{applyCondition},</if>
|
||||
<if test="operateExplain != null">operate_explain = #{operateExplain},</if>
|
||||
<if test="toolPrincipals != null">tool_principals = #{toolPrincipals},</if>
|
||||
<if test="toolPrincipalsName != null">tool_principals_name = #{toolPrincipalsName},</if>
|
||||
<if test="toolRespDept != null">tool_resp_dept = #{toolRespDept},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where tool_id = #{toolId}
|
||||
</update>
|
||||
|
||||
<select id="selectToolList" parameterType="Tool" resultMap="ToolResult">
|
||||
select u.tool_id, u.tool_code, u.tool_name, u.tool_type, u.tool_source, u.tool_use, u.test_situation, u.function_desc, u.apply_condition, u.operate_explain,
|
||||
u.tool_principals, u.tool_principals_name, u.tool_resp_dept, u.status, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from t_tool u
|
||||
left join sys_dept d on u.tool_resp_dept = d.dept_id
|
||||
where 1=1
|
||||
<if test="toolId != null and toolId != ''">
|
||||
AND u.tool_id = #{toolId}
|
||||
</if>
|
||||
<if test="toolCode != null and toolCode != ''">
|
||||
AND u.tool_code = #{toolCode}
|
||||
</if>
|
||||
<if test="toolName != null and toolName != ''">
|
||||
AND u.tool_name like concat('%', #{toolName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND u.status = #{status}
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="toolRespDept != null and toolRespDept != ''">
|
||||
AND u.tool_resp_dept = #{toolRespDept}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<delete id="deleteToolByToolId" parameterType="String">
|
||||
delete from t_tool where tool_id = #{toolId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteToolByToolIds" parameterType="String">
|
||||
delete from t_tool where tool_id in
|
||||
<foreach item="toolId" collection="array" open="(" separator="," close=")">
|
||||
#{toolId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user