FolviteReceiveMapper.xml 5.06 KB
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  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
 160
 161
 162
 163
<?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.lyms.platform.permission.dao.master.FolviteReceiveMapper">

<resultMap id="folviteReceiveResultMap" type="com.lyms.platform.pojo.FolviteRecordModel">
<result column="id" property="id"/>
<result column="folvite_id" property="folviteId"/>
<result column="receive_number" property="receiveNumber"/>
<result column="receive_week" property="receiveWeek"/>
<result column="highrisk" property="highrisk"/>
<result column="provide_unit" property="provideUnit"/>
<result column="issuer" property="issuer"/>
<result column="receive_date" property="receiveDate"/>
<result column="creation_date" property="creationDate"/>
<result column="modified" property="modified"/>
</resultMap>

<insert id="saveFolviteReceive" parameterType="com.lyms.platform.pojo.FolviteReceiveRecordModel">
INSERT INTO lyms_folvite_provide (
id,
folvite_id,
receive_number,
receive_week,
highrisk,
provide_unit,
ISSUER,
receive_date,
creation_date,
modified,
isconceive
)
VALUES
(
#{id,jdbcType=VARCHAR},
#{folviteId,jdbcType=VARCHAR},
#{receiveNumber,jdbcType=INTEGER},
#{receiveWeek,jdbcType=INTEGER},
#{highrisk,jdbcType=VARCHAR},
#{provideUnit,jdbcType=VARCHAR},
#{issuer,jdbcType=VARCHAR},
#{receiveDate,jdbcType=TIMESTAMP},
#{creationDate,jdbcType=TIMESTAMP},
#{modified,jdbcType=TIMESTAMP})
#{isconceive,jdbcType=INTEGER}
</insert>

<select id="queryFolviteReceiveList" parameterType="com.lyms.platform.permission.model.FolviteRecordQuery"
resultMap="folviteReceiveResultMap">
SELECT
id AS id,
folvite_id AS folviteId,
receive_number AS receiveNumber,
receive_week AS receiveWeek,
highrisk AS highrisk,
provide_unit AS provideUnit,
ISSUER AS ISSUER,
receive_date AS receiveDate,
creation_date AS creationDate,
modified AS modified,
isconceive as isconceive
FROM
lyms_folvite_provide
<include refid="whereSql"/>
<include refid="orderAndLimit"/>
</select>

<select id="queyFolviteReceiveCount" parameterType="com.lyms.platform.permission.model.FolviteRecordQuery"
resultType="java.lang.Integer">
select count(id) from lyms_folvite_provide
<include refid="whereSql"/>

</select>

<sql id="whereSql">
1=1
<where>
<if test="folviteId != null">
and folviteId=#{folviteId}
</if>
<if test="">
and id=#{id}
</if>

</where>


</sql>

<update id="updaetFolviteReceive" parameterType="com.lyms.platform.pojo.FolviteReceiveRecordModel">
UPDATE lyms_folvite_provide
<include refid="columnUpdate"/>
where id=#{id,jdbcType=VARCHAR}
</update>

<sql id="columnUpdate">

<set>
<if test="id != null">
id=#{id,jdbcType=VARCHAR},
</if>
<if test="folviteId != null">
folvite_id=#{folviteId,jdbcType=VARCHAR},
</if>
<if test="receiveNumber != null">
receive_number=#{receiveNumber,jdbcType=INTEGER},
</if>
<if test="receiveWeek != null">
receive_week=#{receiveWeek,jdbcType=INTEGER},
</if>
<if test="highrisk != null">
highrisk=#{highrisk,jdbcType=VARCHAR},
</if>
<if test="provideUnit != null">
provide_unit=#{provideUnit,jdbcType=VARCHAR},
</if>
<if test="issuer != null">
issuer=#{issuer,jdbcType=VARCHAR},
</if>
<if test="receiveDate != null">
receive_date=#{receiveDate,jdbcType=TIMESTAMP},
</if>
<if test="creationDate != null">
reation_date=#{creationDate,jdbcType=TIMESTAMP},
</if>
<if test="modified != null">
modified=#{modified,jdbcType=TIMESTAMP},
</if>
<if test="isconceive != null">
isconceive=#{isconceive,jdbcType=INTEGER}
</if>

</set>
</sql>

<select id="queryOneReceive" parameterType="java.lang.String"
resultType="com.lyms.platform.pojo.FolviteReceiveRecordModel">
SELECT
id AS id,
folvite_id AS folviteId,
receive_number AS receiveNumber,
receive_week AS receiveWeek,
highrisk AS highrisk,
provide_unit AS provideUnit,
ISSUER AS ISSUER,
receive_date AS receiveDate,
creation_date AS creationDate,
modified AS modified,
isconceive as isconceive
FROM
lyms_folvite_provide
where id=#{id,jdbcType=VARCHAR}

</select>

<sql id="orderAndLimit">
<if test="sort != null and sort != '' ">
order by ${sort}
<if test="need != null">
limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER}
</if>
</if>
</sql>
</mapper>