WeixinQrcodeConfigMapper.xml 3.84 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
<?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.WeixinQrcodeConfigMapper">

<resultMap id="WeixinShowqrcodeConfigResultMap" type="com.lyms.platform.permission.model.WeixinQrcodeConfig">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="hospitalId" property="hospitalId" jdbcType="VARCHAR" />
<result column="dp_id" property="dpId" jdbcType="INTEGER" />
<result column="ticket" property="ticket" jdbcType="VARCHAR" />
<result column="wx_url" property="wxUrl" jdbcType="VARCHAR" />
<result column="created" property="created" jdbcType="TIMESTAMP" />
<result column="modified" property="modified" jdbcType="TIMESTAMP" />
</resultMap>



<insert id="addWeixinShowqrcodeConfig" parameterType="com.lyms.platform.permission.model.WeixinQrcodeConfig">
<selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER">
SELECT LAST_INSERT_ID()
</selectKey>
insert into weixin_qrcode_config (hospitalId,dp_id,ticket,created,modified,wx_url) values (#{hospitalId},#{dpId},#{ticket},#{created},#{modified},#{wxUrl})
</insert>



<update id="updateWeixinShowqrcodeConfig" parameterType="com.lyms.platform.permission.model.WeixinQrcodeConfig">
update weixin_qrcode_config <set><if test="hospitalId != null and hospitalId != ''">
hospitalId = #{hospitalId,jdbcType=VARCHAR},
</if>

<if test="dpId != null and dpId >= 0">
dp_id = #{dpId,jdbcType=INTEGER},
</if>
<if test="wxUrl != null">
wx_url = #{wxUrl,jdbcType=VARCHAR},
</if>
<if test="ticket != null and ticket != ''">
ticket = #{ticket,jdbcType=VARCHAR},
</if>
<if test="created != null">
created = #{created,jdbcType=TIMESTAMP},
</if>
<if test="modified != null">
modified = #{modified,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>


<delete id="deleteWeixinShowqrcodeConfig" parameterType="java.lang.Integer">
delete from weixin_qrcode_config where id = #{id,jdbcType=INTEGER}
</delete>



<select id="getWeixinShowqrcodeConfig" resultMap="WeixinShowqrcodeConfigResultMap" parameterType="java.lang.Integer">
select id,hospitalId,dp_id,ticket,created,modified,wx_url
from weixin_qrcode_config where id = #{id,jdbcType=INTEGER}
</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>



<sql id="WeixinShowqrcodeConfigCondition">
<where>
1 = 1
<if test="id != null and id >= 0">
and id = #{id,jdbcType=INTEGER}
</if>
<if test="hospitalId != null and hospitalId != ''">
and hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="dpId != null and dpId >= 0">
and dp_id = #{dpId,jdbcType=INTEGER}
</if>
<if test="ticket != null and ticket != ''">
and ticket = #{ticket,jdbcType=VARCHAR}
</if>
<if test="created != null">
and created = #{created,jdbcType=TIMESTAMP}
</if>
<if test="wxUrl != null">
and wx_url = #{wxUrl,jdbcType=VARCHAR}
</if>
<if test="modified != null">
and modified = #{modified,jdbcType=TIMESTAMP}
</if>
</where>
</sql>



<select id="queryWeixinShowqrcodeConfig" resultMap="WeixinShowqrcodeConfigResultMap" parameterType="com.lyms.platform.permission.model.WeixinQrcodeConfigQuery">
select id,hospitalId,dp_id,ticket,created,modified,wx_url
from weixin_qrcode_config
<include refid="WeixinShowqrcodeConfigCondition" />
<include refid="orderAndLimit" />
</select>



<select id="queryWeixinShowqrcodeConfigCount" resultType="int" parameterType="com.lyms.platform.permission.model.WeixinQrcodeConfigQuery">
select count(1) from weixin_qrcode_config
<include refid="WeixinShowqrcodeConfigCondition" />
</select>
</mapper>