KqglAssoTeshuMapper.xml 5.36 KB
Newer Older
ilal committed
1 2 3 4 5 6 7 8 9 10 11 12 13
<?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="cn.timer.api.dao.kqmk.KqglAssoTeshuMapper">

    <resultMap id="BaseResultMap" type="cn.timer.api.bean.kqmk.KqglAssoTeshu" >
                <id column="id" property="id" />
                <result column="kqzid" property="kqzid" />
                <result column="tsrq" property="tsrq" />
                <result column="bcid" property="bcid" />
                <result column="lusj_time" property="lusjTime" />
                <result column="luryid" property="luryid" />
                <result column="type" property="type" />
ilal committed
14
                <result column="legalday" property="legalday" />
ilal committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    </resultMap>

    <sql id="Base_Column_List">
                id,
                kqzid,
                tsrq,
                bcid,
                lusj_time,
                luryid,
                type
    </sql>
    
    <sql id="Base_Column_List_Alias">
                id KqglAssoTeshu_id,
                kqzid KqglAssoTeshu_kqzid,
                tsrq KqglAssoTeshu_tsrq,
                bcid KqglAssoTeshu_bcid,
                lusj_time KqglAssoTeshu_lusj_time,
                luryid KqglAssoTeshu_luryid,
                type KqglAssoTeshu_type
    </sql>

ilal committed
37
	<insert id="insertKqglAssoTeshuList" parameterType="java.util.List" >
ilal committed
38
	    insert into kqgl_asso_teshu (kqzid, tsrq, bcid, lusj_time, luryid, type,legalday)
ilal committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
	    <foreach collection="list" item="item" index="index" open="values " close="" separator=",">
	   	(
	      <if test="item.kqzid != null" >
	        #{item.kqzid,jdbcType=INTEGER},
	      </if>
	      <if test="item.tsrq != null" >
	        #{item.tsrq,jdbcType=VARCHAR},
	      </if>
	      <if test="item.bcid != null" >
	        #{item.bcid,jdbcType=INTEGER},
	      </if>
	      <if test="item.lusjTime != null" >
	        #{item.lusjTime,jdbcType=BIGINT},
	      </if>
	      <if test="item.luryid != null" >
	        #{item.luryid,jdbcType=INTEGER},
	      </if>
	      <if test="item.type != null" >
ilal committed
57 58 59 60
	        #{item.type,jdbcType=INTEGER},
	      </if>
	      <if test="item.legalday != null" >
	        #{item.legalday,jdbcType=INTEGER}
ilal committed
61 62 63 64
	      </if>
	      )
	    </foreach>
   </insert>
lal committed
65 66 67 68 69
   
   <select id="ShouldSpecialDatessetByKqzid" resultMap="BaseResultMap">
   	select <include refid="Base_Column_List" />
		from kqgl_asso_teshu teshu
			where teshu.kqzid = #{kqzid}
lal committed
70
			and SUBSTR(teshu.tsrq,1,7) = #{tsrq}
lal committed
71
			and teshu.type = #{type}
ilal committed
72
			and teshu.legalday = 0
lal committed
73 74
   </select>
   
ilal committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
	<!-- 

    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoTeshu">
        INSERT INTO kqgl_asso_teshu
        <trim prefix="(" suffix=")" suffixOverrides=",">
                        <if test ='null != kqzid'>
                        kqzid,
                        </if>
                        <if test ='null != tsrq'>
                        tsrq,
                        </if>
                        <if test ='null != bcid'>
                        bcid,
                        </if>
                        <if test ='null != lusjTime'>
                        lusj_time,
                        </if>
                        <if test ='null != luryid'>
                        luryid,
                        </if>
                        <if test ='null != type'>
                        type
                        </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                        <if test ='null != kqzid'>
                        #{kqzid},
                        </if>
                        <if test ='null != tsrq'>
                        #{tsrq},
                        </if>
                        <if test ='null != bcid'>
                        #{bcid},
                        </if>
                        <if test ='null != lusjTime'>
                        #{lusjTime},
                        </if>
                        <if test ='null != luryid'>
                        #{luryid},
                        </if>
                        <if test ='null != type'>
                        #{type}
                        </if>
        </trim>
    </insert>

    <delete id="delete" >
        DELETE FROM kqgl_asso_teshu
        WHERE id = #{id}
    </delete>

    <update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoTeshu">
        UPDATE kqgl_asso_teshu
        <set>
                    <if test ='null != kqzid'>kqzid = #{kqzid},</if>
                    <if test ='null != tsrq'>tsrq = #{tsrq},</if>
                    <if test ='null != bcid'>bcid = #{bcid},</if>
                    <if test ='null != lusjTime'>lusj_time = #{lusjTime},</if>
                    <if test ='null != luryid'>luryid = #{luryid},</if>
                    <if test ='null != type'>type = #{type}</if>
        </set>
        WHERE id = #{id}
    </update>


    <select id="load" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM kqgl_asso_teshu
        WHERE id = #{id}
    </select>

    <select id="pageList" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM kqgl_asso_teshu
        LIMIT #{offset}, #{pageSize}
    </select>

    <select id="pageListCount" resultType="java.lang.Integer">
        SELECT count(1)
        FROM kqgl_asso_teshu
    </select>

	 -->

</mapper>