1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?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.gqy.document.mapper.DcSystemMapper">
- <resultMap type="DcSystem" id="DcSystemResult">
- <id property="sysId" column="sys_id" />
- <result property="sysName" column="sys_name" />
- <result property="sysNo" column="sys_no" />
- <result property="sysRemark" column="sys_remark" />
- <result property="sysProducts" column="sys_products" />
- <result property="sysStatus" column="sys_status" />
- </resultMap>
- <sql id="selectDcSystemVo">
- select sys_id, sys_name, sys_no, sys_remark, sys_products,sys_status
- from dc_system
- </sql>
- <select id="selectDcSystemList" parameterType="DcSystem" resultMap="DcSystemResult">
- <include refid="selectDcSystemVo"/>
- <where>
- <if test="sysId!= null">
- AND sys_id = #{sysId}
- </if>
- <if test="sysName != null and sysName != ''">
- AND sys_name like concat('%', #{sysName}, '%')
- </if>
- <if test="sysNo != null and sysNo != ''">
- AND sys_no = #{sysNo}
- </if>
- <if test="sysStatus!= null">
- AND sys_status = #{sysStatus}
- </if>
- </where>
- order by sys_id desc
- </select>
- <select id="selectDcSystemById" parameterType="Long" resultMap="DcSystemResult">
- <include refid="selectDcSystemVo"/>
- where sys_id = #{sys_id}
- </select>
- <insert id="insertDcSystem" parameterType="DcSystem" useGeneratedKeys="true" keyProperty="sysId">
- insert into dc_system
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="sysName != null">sys_name,</if>
- <if test="sysNo != null">sys_no,</if>
- <if test="sysRemark != null">sys_remark,</if>
- <if test="sysProducts != null">sys_products,</if>
- <if test="sysStatus != null">sys_status,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="sysName != null">#{sysName},</if>
- <if test="sysNo != null">#{sysNo},</if>
- <if test="sysRemark != null">#{sysRemark},</if>
- <if test="sysProducts != null">#{sysProducts},</if>
- <if test="sysStatus != null">#{sysStatus}</if>
- </trim>
- </insert>
- <update id="updateDcSystem" parameterType="DcSystem">
- update dc_system
- <set>
- <if test="sysName != null">sys_name = #{sysName},</if>
- <if test="sysNo != null">sys_no = #{sysNo},</if>
- <if test="sysRemark != null">sys_remark = #{sysRemark},</if>
- <if test="sysProducts != null">sys_products = #{sysProducts}</if>
- <if test="sysStatus != null">sys_status = #{sysStatus}</if>
- </set>
- where sys_id = #{sysId}
- </update>
- <delete id="deleteDcSystemById" parameterType="Long">
- delete from dc_system where sys_id = #{sys_id}
- </delete>
- <delete id="deleteDcSystemByIds" parameterType="String">
- delete from dc_system where sys_id in
- <foreach item="sys_id" collection="array" open="(" separator="," close=")">
- #{sys_id}
- </foreach>
- </delete>
- </mapper>
|