1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?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.DcSpecMapper">
- <resultMap type="DcSpec" id="DcSpecResult">
- <result property="ps_id" column="ps_id" />
- <result property="ps_p_id" column="ps_p_id" />
- <result property="ps_no" column="pa_no" />
- <result property="ps_name" column="ps_name" />
- <result property="ps_status" column="ps_status" />
- <result property="ps_dck_id" column="ps_dck_id" />
- </resultMap>
- <sql id="selectDcSpecVo">
- select ps_id, ps_p_id, pa_no, ps_name, ps_dck_id from dc_spec
- </sql>
- <select id="selectDcSpecList" parameterType="DcSpec" resultMap="DcSpecResult">
- <include refid="selectDcSpecVo"/>
- <where>
- <if test="ps_p_id != null and ps_p_id != ''"> and ps_p_id = #{ps_p_id}</if>
- <if test="pa_no != null and pa_no != ''"> and pa_no = #{pa_no}</if>
- <if test="ps_name != null and ps_name != ''"> and ps_name like concat('%', #{ps_name}, '%')</if>
- <if test="ps_dck_id != null "> and ps_dck_id = #{ps_dck_id}</if>
- </where>
- </select>
- <!-- 其他SQL语句的参数名也需要相应修改 -->
- <insert id="insertDcSpec" parameterType="DcSpec" useGeneratedKeys="true" keyProperty="ps_id">
- insert into dc_spec
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ps_p_id != null and ps_p_id != ''">ps_p_id,</if>
- <if test="pa_no != null and pa_no != ''">pa_no,</if>
- <if test="ps_name != null and ps_name != ''">ps_name,</if>
- <if test="ps_dck_id != null">ps_dck_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="ps_p_id != null and ps_p_id != ''">#{ps_p_id},</if>
- <if test="pa_no != null and pa_no != ''">#{pa_no},</if>
- <if test="ps_name != null and ps_name != ''">#{ps_name},</if>
- <if test="ps_dck_id != null">#{ps_dck_id},</if>
- </trim>
- </insert>
- <update id="updateDcSpec" parameterType="DcSpec">
- update dc_spec
- <trim prefix="SET" suffixOverrides=",">
- <if test="ps_p_id != null">ps_p_id = #{ps_p_id},</if>
- <if test="pa_no != null">pa_no = #{pa_no},</if>
- <if test="ps_name != null">ps_name = #{ps_name},</if>
- <if test="ps_dck_id != null">ps_dck_id = #{ps_dck_id},</if>
- </trim>
- where ps_id = #{ps_id}
- </update>
- <select id="selectDcSpecById" parameterType="Integer" resultMap="DcSpecResult">
- <include refid="selectDcSpecVo"/>
- where ps_id = #{ps_id}
- </select>
- </mapper>
|