MouldOperationDynamicsMapper.xml 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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.hssx.cloudmodel.mapper.MouldOperationDynamicsMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.hssx.cloudmodel.entity.MouldOperationDynamics">
  6. <id column="id" property="id"/>
  7. <result column="file_id" property="fileId"/>
  8. <result column="operator_id" property="operatorId"/>
  9. <result column="operator_name" property="operatorName"/>
  10. <result column="indate" property="indate"/>
  11. <result column="file_name" property="fileName"/>
  12. <result column="belong_type" property="belongType"/>
  13. <result column="content" property="content"/>
  14. <result column="mould_id" property="mouldId"/>
  15. <result column="is_pass" property="isPass"/>
  16. <result column="applicant_id" property="applicantId"/>
  17. <result column="applicant_name" property="applicantName"/>
  18. </resultMap>
  19. <!-- 通用查询映射结果 -->
  20. <resultMap id="BaseResultMapVO" type="com.hssx.cloudmodel.entity.vo.MouldOperationDynamicsVO">
  21. <id column="id" property="id"/>
  22. <result column="file_id" property="fileId"/>
  23. <result column="operator_id" property="operatorId"/>
  24. <result column="operator_name" property="operatorName"/>
  25. <result column="indate" property="indate"/>
  26. <result column="file_name" property="fileName"/>
  27. <result column="belong_type" property="belongType"/>
  28. <result column="content" property="content"/>
  29. <result column="mould_id" property="mouldId"/>
  30. <result column="is_pass" property="isPass"/>
  31. <result column="applicant_id" property="applicantId"/>
  32. <result column="applicant_name" property="applicantName"/>
  33. <result column="mouldNo" property="mouldNo"/>
  34. </resultMap>
  35. <!-- 通用查询结果列 -->
  36. <sql id="Base_Column_List">
  37. id, file_id, operator_id, operator_name, indate, file_name, belong_type, content, mould_id, is_pass, applicant_id, applicant_name
  38. </sql>
  39. <select id="selectOperationDynamicsList" resultMap="BaseResultMap">
  40. select
  41. <include refid="Base_Column_List"/>
  42. from
  43. tb_mould_operation_dynamics
  44. <where>
  45. mould_id = #{userVO.mouldId}
  46. and content = '下载'
  47. <if test="userVO.startTime != null and userVO.endTime != null">
  48. and DATE_FORMAT(indate,'%Y-%m-%d') between #{userVO.startTime} and #{userVO.endTime}
  49. </if>
  50. </where>
  51. </select>
  52. <select id="getlist" resultMap="BaseResultMapVO">
  53. select
  54. tmod.id, tmod.file_id, tmod.operator_id, tmod.operator_name, tmod.indate, tmod.file_name, tmod.belong_type,
  55. tmod.content, tmod.mould_id, tmod.is_pass, tmod.applicant_id, tmod.applicant_name,tbm.model_no mouldNo
  56. from
  57. tb_mould_operation_dynamics tmod
  58. left join
  59. tb_mould tbm
  60. on
  61. tmod.mould_id = tbm.id
  62. <where>
  63. tmod.mould_id in
  64. <foreach collection="list" index="index" open="(" item="item" close=")" separator=",">
  65. #{item}
  66. </foreach>
  67. and tmod.belong_type = #{mouldOperationDynamics.belongType}
  68. Order By tmod.id desc
  69. </where>
  70. </select>
  71. </mapper>