CmAdminMobileMapper.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.caimei.modules.user.dao.CmAdminMobileMapper">
  6. <resultMap type="com.caimei.modules.user.entity.CmAdminMobile" id="CmAdminMobileResult">
  7. <result property="id" column="id" />
  8. <result property="type" column="type" />
  9. <result property="mobile" column="mobile" />
  10. <result property="enabledStatus" column="enabledStatus" />
  11. <result property="delFlag" column="delFlag" />
  12. <result property="updateTime" column="updateTime" />
  13. <result property="createTime" column="createTime" />
  14. </resultMap>
  15. <sql id="selectCmAdminMobileVo">
  16. select
  17. cm_admin_mobile.id,
  18. cm_admin_mobile.type,
  19. cm_admin_mobile.mobile,
  20. cm_admin_mobile.enabledStatus,
  21. cm_admin_mobile.delFlag,
  22. cm_admin_mobile.updateTime,
  23. cm_admin_mobile.createTime
  24. </sql>
  25. <select id="getByCmAdminMobile" parameterType="com.caimei.modules.user.entity.CmAdminMobile" resultMap="CmAdminMobileResult">
  26. <include refid="selectCmAdminMobileVo"/>
  27. from cm_admin_mobile AS cm_admin_mobile
  28. <where> cm_admin_mobile.delFlag = 0
  29. <if test="id != null "> and cm_admin_mobile.id = #{id}</if>
  30. <if test="type != null and type != ''"> and cm_admin_mobile.type = #{type}</if>
  31. <if test="mobile != null and mobile != ''"> and cm_admin_mobile.mobile = #{mobile}</if>
  32. <if test="enabledStatus != null and enabledStatus != ''"> and cm_admin_mobile.enabledStatus = #{enabledStatus}</if>
  33. <if test="updateTime != null "> and cm_admin_mobile.updateTime = #{updateTime}</if>
  34. <if test="createTime != null "> and cm_admin_mobile.createTime = #{createTime}</if>
  35. </where>
  36. group by cm_admin_mobile.id
  37. order by cm_admin_mobile.createTime desc
  38. limit 0,1
  39. </select>
  40. <select id="getCmAdminMobileList" parameterType="com.caimei.modules.user.entity.CmAdminMobile" resultMap="CmAdminMobileResult">
  41. <include refid="selectCmAdminMobileVo"/>
  42. from cm_admin_mobile AS cm_admin_mobile
  43. <where> cm_admin_mobile.delFlag = 0
  44. <if test="id != null and id != ''">
  45. and cm_admin_mobile.id
  46. <if test="id.toUpperCase().indexOf('=')==-1">
  47. = #{id}
  48. </if>
  49. <if test="id.toUpperCase().indexOf('=')!=-1">
  50. <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
  51. <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
  52. <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
  53. #{idIn}
  54. </foreach>
  55. </if>
  56. </if>
  57. <if test="type != null and type != ''"> and cm_admin_mobile.type = #{type}</if>
  58. <if test="mobile != null and mobile != ''"> and cm_admin_mobile.mobile = #{mobile}</if>
  59. <if test="enabledStatus != null and enabledStatus != ''"> and cm_admin_mobile.enabledStatus = #{enabledStatus}</if>
  60. <if test="updateTime != null "> and cm_admin_mobile.updateTime = #{updateTime}</if>
  61. <if test="createTime != null "> and cm_admin_mobile.createTime = #{createTime}</if>
  62. </where>
  63. group by cm_admin_mobile.id
  64. order by cm_admin_mobile.createTime desc
  65. </select>
  66. <select id="getCount" parameterType="com.caimei.modules.user.entity.CmAdminMobile" resultType="int">
  67. select count(1)
  68. from cm_admin_mobile AS cm_admin_mobile
  69. <where> cm_admin_mobile.delFlag = 0
  70. <if test="id != null "> and cm_admin_mobile.id = #{id}</if>
  71. <if test="type != null and type != ''"> and cm_admin_mobile.type = #{type}</if>
  72. <if test="mobile != null and mobile != ''"> and cm_admin_mobile.mobile = #{mobile}</if>
  73. <if test="enabledStatus != null and enabledStatus != ''"> and cm_admin_mobile.enabledStatus = #{enabledStatus}</if>
  74. <if test="updateTime != null "> and cm_admin_mobile.updateTime = #{updateTime}</if>
  75. <if test="createTime != null "> and cm_admin_mobile.createTime = #{createTime}</if>
  76. </where>
  77. </select>
  78. <select id="getCmAdminMobileById" parameterType="String" resultMap="CmAdminMobileResult">
  79. <include refid="selectCmAdminMobileVo"/>
  80. from cm_admin_mobile AS cm_admin_mobile
  81. where cm_admin_mobile.delFlag = 0 and cm_admin_mobile.id = #{id}
  82. </select>
  83. <select id="getById" parameterType="com.caimei.modules.user.entity.CmAdminMobile" resultType="String">
  84. select id
  85. from cm_admin_mobile AS cm_admin_mobile
  86. <where> cm_admin_mobile.delFlag = 0
  87. <if test="id != null "> and cm_admin_mobile.id = #{id}</if>
  88. <if test="type != null and type != ''"> and cm_admin_mobile.type = #{type}</if>
  89. <if test="mobile != null and mobile != ''"> and cm_admin_mobile.mobile = #{mobile}</if>
  90. <if test="enabledStatus != null and enabledStatus != ''"> and cm_admin_mobile.enabledStatus = #{enabledStatus}</if>
  91. <if test="updateTime != null "> and cm_admin_mobile.updateTime = #{updateTime}</if>
  92. <if test="createTime != null "> and cm_admin_mobile.createTime = #{createTime}</if>
  93. </where>
  94. group by cm_admin_mobile.id
  95. limit 0,1
  96. </select>
  97. <insert id="addCmAdminMobile" parameterType="com.caimei.modules.user.entity.CmAdminMobile" useGeneratedKeys="true" keyProperty="id">
  98. insert into cm_admin_mobile
  99. <trim prefix="(" suffix=")" suffixOverrides=",">
  100. <if test="id != null and id != ''">id,</if>
  101. <if test="type != null and type != ''">type,</if>
  102. <if test="mobile != null and mobile != ''">mobile,</if>
  103. <if test="enabledStatus != null and enabledStatus != ''">enabledStatus,</if>
  104. <if test="delFlag != null">delFlag,</if>
  105. <if test="updateTime != null">updateTime,</if>
  106. <if test="createTime != null">createTime,</if>
  107. </trim>
  108. <trim prefix="values (" suffix=")" suffixOverrides=",">
  109. <if test="id != null and id != ''">#{id},</if>
  110. <if test="type != null and type != ''">#{type},</if>
  111. <if test="mobile != null and mobile != ''">#{mobile},</if>
  112. <if test="enabledStatus != null and enabledStatus != ''">#{enabledStatus},</if>
  113. <if test="delFlag != null">#{delFlag},</if>
  114. <if test="updateTime != null">#{updateTime},</if>
  115. <if test="createTime != null">#{createTime},</if>
  116. </trim>
  117. </insert>
  118. <update id="updateCmAdminMobile" parameterType="com.caimei.modules.user.entity.CmAdminMobile">
  119. update cm_admin_mobile
  120. <trim prefix="SET" suffixOverrides=",">
  121. <if test="type != null and type != ''">type = #{type},</if>
  122. <if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
  123. <if test="enabledStatus != null and enabledStatus != ''">enabledStatus = #{enabledStatus},</if>
  124. <if test="delFlag != null">delFlag = #{delFlag},</if>
  125. <if test="updateTime != null">updateTime = #{updateTime},</if>
  126. <if test="createTime != null">createTime = #{createTime},</if>
  127. </trim>
  128. where id = #{id}
  129. </update>
  130. <delete id="delCmAdminMobileById" parameterType="String">
  131. delete
  132. from cm_admin_mobile where id = #{id}
  133. </delete>
  134. <delete id="delCmAdminMobile" parameterType="com.caimei.modules.user.entity.CmAdminMobile">
  135. delete
  136. from cm_admin_mobile AS cm_admin_mobile
  137. <where>
  138. <if test="id != null "> and cm_admin_mobile.id = #{id}</if>
  139. <if test="type != null and type != ''"> and cm_admin_mobile.type = #{type}</if>
  140. <if test="mobile != null and mobile != ''"> and cm_admin_mobile.mobile = #{mobile}</if>
  141. <if test="enabledStatus != null and enabledStatus != ''"> and cm_admin_mobile.enabledStatus = #{enabledStatus}</if>
  142. <if test="delFlag != null "> and cm_admin_mobile.delFlag = #{delFlag}</if>
  143. <if test="updateTime != null "> and cm_admin_mobile.updateTime = #{updateTime}</if>
  144. <if test="createTime != null "> and cm_admin_mobile.createTime = #{createTime}</if>
  145. </where>
  146. </delete>
  147. </mapper>