WdInfoMapper.xml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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.ruoyi.demo.mapper.WdInfoMapper">
  6. <resultMap type="com.ruoyi.demo.entity.vo.AddStatusVo" id="AddStatusResult">
  7. <result property="typeCode" column="wd_type_code"/>
  8. <result property="count" column="count"/>
  9. <result property="time" column="time"/>
  10. </resultMap>
  11. <select id="list" parameterType="com.ruoyi.demo.entity.vo.WdInfoVo" resultType="com.ruoyi.demo.entity.WdInfo">
  12. select * from ddt_wd_info
  13. <where>
  14. <if test="wd.wdName != null and wd.wdName != ''">
  15. and wd_name like concat("%",#{wd.wdName},"%")
  16. </if>
  17. <if test="wd.typeCodeBy != null and wd.typeCodeBy != ''">
  18. and type_code_by = #{wd.typeCodeBy}
  19. </if>
  20. <if test="wd.addrCode != null and wd.addrCode != ''">
  21. and addr_code = #{wd.addrCode}
  22. </if>
  23. <if test="wd.showDelete != -1">
  24. and show_delete = #{wd.showDelete}
  25. </if>
  26. </where>
  27. </select>
  28. <select id="searchAddStatusByMulti" resultMap="AddStatusResult">
  29. SELECT
  30. wd_type_code,
  31. COUNT(*) count,
  32. DATE_FORMAT(collect_time, "%Y-%m") time
  33. FROM
  34. `ddt_wd_info`
  35. <trim prefix="where" prefixOverrides="and">
  36. <if test="times != null">
  37. <foreach collection="times" item="time" open="and DATE_FORMAT(collect_time, '%Y-%m') IN (" separator="," close=")">
  38. #{time,jdbcType=VARCHAR}
  39. </foreach>
  40. </if>
  41. <if test="addrCodes != null">
  42. <foreach collection="addrCodes" item="addrCode" open="and addr_code IN (" separator="," close=")">
  43. #{addrCode,jdbcType=VARCHAR}
  44. </foreach>
  45. </if>
  46. <if test="wdTypeCodes != null">
  47. <foreach collection="wdTypeCodes" item="type" open="and wd_type_code IN (" separator="," close=")">
  48. #{type,jdbcType=VARCHAR}
  49. </foreach>
  50. </if>
  51. </trim>
  52. GROUP BY
  53. wd_type_code,
  54. time
  55. </select>
  56. <update id="recoverWd" parameterType="java.lang.String">
  57. update ddt_wd_info set show_delete = 0 where wd_id = #{wdId}
  58. </update>
  59. <select id="selectChannel" resultType="com.ruoyi.demo.entity.vo.ChannelVo">
  60. SELECT
  61. dwi.wd_img,
  62. dwi.wd_name,
  63. dsw.contact,
  64. dsw.telephone,
  65. channel_type
  66. FROM
  67. `ddt_store_wd` dsw
  68. LEFT JOIN `ddt_wd_info` dwi ON dwi.wd_id = dsw.wd_id ${ew.customSqlSegment}
  69. </select>
  70. </mapper>