CashierLoginRecordDao.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.kmall.admin.dao.CashierLoginRecordDao">
  4. <resultMap type="com.kmall.admin.entity.CashierLoginRecordEntity" id="cashierLoginRecordMap">
  5. <result property="mclrId" column="mclr_id"/>
  6. <result property="sallerId" column="saller_id"/>
  7. <result property="cashierId" column="cashier_id"/>
  8. <result property="shopSn" column="shop_sn"/>
  9. <result property="loginTime" column="login_time"/>
  10. <result property="createrSn" column="creater_sn"/>
  11. <result property="createTime" column="create_time"/>
  12. <result property="moderSn" column="moder_sn"/>
  13. <result property="modTime" column="mod_time"/>
  14. <result property="tstm" column="tstm"/>
  15. </resultMap>
  16. <select id="queryObject" resultType="com.kmall.admin.entity.CashierLoginRecordEntity">
  17. select
  18. `mclr_id`,
  19. `saller_id`,
  20. `cashier_id`,
  21. `shop_sn`,
  22. `login_time`,
  23. `creater_sn`,
  24. `create_time`,
  25. `moder_sn`,
  26. `mod_time`,
  27. `tstm`
  28. from mall2_cashier_login_record
  29. where mclr_id = #{id}
  30. </select>
  31. <select id="queryList" resultType="com.kmall.admin.entity.CashierLoginRecordEntity">
  32. select
  33. record.mclr_id,
  34. record.saller_id,
  35. record.cashier_id,
  36. record.shop_sn,
  37. record.login_time,
  38. record.creater_sn,
  39. record.create_time,
  40. record.moder_sn,
  41. record.mod_time,
  42. record.tstm,
  43. store.store_name as shopName
  44. from mall2_cashier_login_record record
  45. left join mall_store store on record.shop_sn = store.id
  46. WHERE 1=1
  47. <if test="name != null and name.trim() != ''">
  48. AND name LIKE concat('%',#{name},'%')
  49. </if>
  50. <choose>
  51. <when test="sidx != null and sidx.trim() != ''">
  52. order by ${sidx} ${order}
  53. </when>
  54. <otherwise>
  55. order by mclr_id desc
  56. </otherwise>
  57. </choose>
  58. <if test="offset != null and limit != null">
  59. limit #{offset}, #{limit}
  60. </if>
  61. </select>
  62. <select id="queryTotal" resultType="int">
  63. select count(*) from mall2_cashier_login_record
  64. WHERE 1=1
  65. <if test="name != null and name.trim() != ''">
  66. AND name LIKE concat('%',#{name},'%')
  67. </if>
  68. </select>
  69. <insert id="save" parameterType="com.kmall.admin.entity.CashierLoginRecordEntity">
  70. insert into mall2_cashier_login_record(
  71. `mclr_id`,
  72. `saller_id`,
  73. `cashier_id`,
  74. `shop_sn`,
  75. `login_time`,
  76. `creater_sn`,
  77. `create_time`,
  78. `moder_sn`,
  79. `mod_time`,
  80. `tstm`)
  81. values(
  82. #{mclrId},
  83. #{sallerId},
  84. #{cashierId},
  85. #{shopSn},
  86. #{loginTime},
  87. #{createrSn},
  88. #{createTime},
  89. #{moderSn},
  90. #{modTime},
  91. #{tstm})
  92. </insert>
  93. <update id="update" parameterType="com.kmall.admin.entity.CashierLoginRecordEntity">
  94. update mall2_cashier_login_record
  95. <set>
  96. <if test="sallerId != null">`saller_id` = #{sallerId}, </if>
  97. <if test="cashierId != null">`cashier_id` = #{cashierId}, </if>
  98. <if test="shopSn != null">`shop_sn` = #{shopSn}, </if>
  99. <if test="loginTime != null">`login_time` = #{loginTime}, </if>
  100. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  101. <if test="createTime != null">`create_time` = #{createTime}, </if>
  102. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  103. <if test="modTime != null">`mod_time` = #{modTime}, </if>
  104. <if test="tstm != null">`tstm` = #{tstm}</if>
  105. </set>
  106. where mclr_id = #{mclrId}
  107. </update>
  108. <delete id="delete">
  109. delete from mall2_cashier_login_record where mclr_id = #{value}
  110. </delete>
  111. <delete id="deleteBatch">
  112. delete from mall2_cashier_login_record where mclr_id in
  113. <foreach item="mclrId" collection="array" open="(" separator="," close=")">
  114. #{mclrId}
  115. </foreach>
  116. </delete>
  117. </mapper>