123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <?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.zkqy.business.mapper.MaterielMapper">
-
- <resultMap type="com.zkqy.business.domain.Materiel" id="MaterielResult">
- <result property="id" column="id" />
- <result property="materielCode" column="materiel_code" />
- <result property="materielName" column="materiel_name" />
- <result property="materielAsname" column="materiel_asname" />
- <result property="subordinateDepartmen" column="subordinate_departmen" />
- <result property="materielSpecies" column="materiel_species" />
- <result property="materielUse" column="materiel_use" />
- <result property="units" column="units" />
- <result property="specificationModel" column="specification_model" />
- <result property="status" column="status" />
- <result property="dataApprovalStatus" column="data_approval_status" />
- <result property="remark" column="remark" />
- <result property="createById" column="create_by_id" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateById" column="update_by_id" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="delFlag" column="del_flag" />
- <result property="taskProcessKey" column="task_process_key" />
- <result property="taskNodeKey" column="task_node_key" />
- <result property="materieEncoding" column="materie_encoding" />
- <result property="materieColorNumber" column="materie_color_number" />
- </resultMap>
- <sql id="selectMaterielVo">
- select id, materiel_code, materiel_name, materiel_asname, subordinate_departmen, materiel_species, materiel_use, units, specification_model, status, data_approval_status, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, task_process_key,
- task_node_key,materie_encoding,materie_color_number from {DBNAME}.materiel
- </sql>
- <select id="selectMaterielList" parameterType="com.zkqy.business.domain.Materiel" resultMap="MaterielResult">
- <include refid="selectMaterielVo"/>
- where del_flag = '0'
- <if test="materielCode != null and materielCode != ''"> and materiel_code = #{materielCode}</if>
- <if test="materielName != null and materielName != ''"> and materiel_name like concat('%', #{materielName}, '%')</if>
- <if test="materielAsname != null and materielAsname != ''"> and materiel_asname like concat('%', #{materielAsname}, '%')</if>
- <if test="subordinateDepartmen != null "> and subordinate_departmen = #{subordinateDepartmen}</if>
- <if test="materielSpecies != null and materielSpecies != ''"> and materiel_species = #{materielSpecies}</if>
- <if test="materielUse != null and materielUse != ''"> and materiel_use = #{materielUse}</if>
- <if test="units != null and units != ''"> and units = #{units}</if>
- <if test="specificationModel != null and specificationModel != ''"> and specification_model = #{specificationModel}</if>
- <if test="status != null and status != ''"> and status = #{status}</if>
- <if test="dataApprovalStatus != null and dataApprovalStatus != ''"> and data_approval_status = #{dataApprovalStatus}</if>
- <if test="createById != null "> and create_by_id = #{createById}</if>
- <if test="updateById != null "> and update_by_id = #{updateById}</if>
- <if test="taskProcessKey != null and taskProcessKey != ''"> and task_process_key = #{taskProcessKey}</if>
- <if test="taskNodeKey != null and taskNodeKey != ''"> and task_node_key = #{taskNodeKey}</if>
- <if test="materieEncoding != null and materieEncoding != ''"> and materie_encoding = #{materieEncoding}</if>
- <if test="materieColorNumber != null and materieColorNumber != ''"> and materie_color_number = #{materieColorNumber}</if>
- </select>
- <select id="selectMaterielById" parameterType="Long" resultMap="MaterielResult">
- <include refid="selectMaterielVo"/>
- where id = #{id}
- </select>
- <select id="selectMaterielByMaterielCode" resultType="com.zkqy.business.domain.Materiel">
- <include refid="selectMaterielVo"/>
- where materiel_code = #{materielCode}
- </select>
- <insert id="insertMateriel" parameterType="com.zkqy.business.domain.Materiel" useGeneratedKeys="true" keyProperty="id">
- insert into {DBNAME}.materiel
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="materielCode != null">materiel_code,</if>
- <if test="materielName != null">materiel_name,</if>
- <if test="materielAsname != null">materiel_asname,</if>
- <if test="subordinateDepartmen != null">subordinate_departmen,</if>
- <if test="materielSpecies != null">materiel_species,</if>
- <if test="materielUse != null">materiel_use,</if>
- <if test="units != null">units,</if>
- <if test="specificationModel != null">specification_model,</if>
- <if test="status != null">status,</if>
- <if test="dataApprovalStatus != null">data_approval_status,</if>
- <if test="remark != null">remark,</if>
- <if test="createById != null">create_by_id,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateById != null">update_by_id,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="taskProcessKey != null">task_process_key,</if>
- <if test="taskNodeKey != null">task_node_key,</if>
- <if test="materieEncoding != null">materie_encoding,</if>
- <if test="materieColorNumber != null">materie_color_number,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="materielCode != null">#{materielCode},</if>
- <if test="materielName != null">#{materielName},</if>
- <if test="materielAsname != null">#{materielAsname},</if>
- <if test="subordinateDepartmen != null">#{subordinateDepartmen},</if>
- <if test="materielSpecies != null">#{materielSpecies},</if>
- <if test="materielUse != null">#{materielUse},</if>
- <if test="units != null">#{units},</if>
- <if test="specificationModel != null">#{specificationModel},</if>
- <if test="status != null">#{status},</if>
- <if test="dataApprovalStatus != null">#{dataApprovalStatus},</if>
- <if test="remark != null">#{remark},</if>
- <if test="createById != null">#{createById},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateById != null">#{updateById},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="taskProcessKey != null">#{taskProcessKey},</if>
- <if test="taskNodeKey != null">#{taskNodeKey},</if>
- <if test="materieEncoding != null">#{materieEncoding},</if>
- <if test="materieColorNumber != null">#{materieColorNumber},</if>
- </trim>
- </insert>
- <update id="updateMateriel" parameterType="com.zkqy.business.domain.Materiel">
- update {DBNAME}.materiel
- <trim prefix="SET" suffixOverrides=",">
- <if test="materielCode != null">materiel_code = #{materielCode},</if>
- <if test="materielName != null">materiel_name = #{materielName},</if>
- <if test="materielAsname != null">materiel_asname = #{materielAsname},</if>
- <if test="subordinateDepartmen != null">subordinate_departmen = #{subordinateDepartmen},</if>
- <if test="materielSpecies != null">materiel_species = #{materielSpecies},</if>
- <if test="materielUse != null">materiel_use = #{materielUse},</if>
- <if test="units != null">units = #{units},</if>
- <if test="specificationModel != null">specification_model = #{specificationModel},</if>
- <if test="status != null">status = #{status},</if>
- <if test="dataApprovalStatus != null">data_approval_status = #{dataApprovalStatus},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="createById != null">create_by_id = #{createById},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateById != null">update_by_id = #{updateById},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
- <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
- <if test="materieEncoding != null">materie_encoding = #{materieEncoding},</if>
- <if test="materieColorNumber != null">materie_color_number = #{materieColorNumber},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteMaterielById" parameterType="Long">
- delete from {DBNAME}.materiel where id = #{id}
- </delete>
- <delete id="deleteMaterielByIds" parameterType="String">
- delete from {DBNAME}.materiel where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="queryMaterielList" resultMap="MaterielResult">
- <include refid="selectMaterielVo"/>
- where del_flag = '0' and materiel_species = '1' order by materiel_name desc
- </select>
- </mapper>
|