FormulaParaMapper.xml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.predict.mapper.FormulaParaMapper">
  6. <resultMap type="FormulaPara" id="FormulaParaResult">
  7. <result property="formulaNo" column="formula_no"/>
  8. <result property="formulaParaNo" column="formula_para_no"/>
  9. <result property="formulaParaName" column="formula_para_name"/>
  10. <result property="formulaParaDesc" column="formula_para_desc"/>
  11. <result property="formulaParaType" column="formula_para_type"/>
  12. <result property="formulaParaIsnormal" column="formula_para_isnormal"/>
  13. <result property="formulaParaIslock" column="formula_para_islock"/>
  14. </resultMap>
  15. <sql id="selectFormulaParaVo">
  16. select formula_no, formula_para_no, formula_para_name, formula_para_desc, formula_para_type, formula_para_isnormal, formula_para_islock from formula_para
  17. </sql>
  18. <select id="selectFormulaParaList" parameterType="FormulaPara" resultMap="FormulaParaResult">
  19. select
  20. fp.*,
  21. f.formula_name as "formulaName",
  22. emi1.item_name as "formulaParaTypeName",
  23. emi2.item_name as "formulaParaIslockName"
  24. from
  25. formula_para fp
  26. left join formula f on f.formula_no = fp.formula_no
  27. left join enum_menu_item emi1 on emi1.item_val = fp.formula_para_type and emi1.menu_no = 190
  28. left join enum_menu_item emi2 on emi2.item_val = fp.formula_para_islock and emi2.menu_no = 121
  29. <where>
  30. <if test="formulaNo != null ">and fp.formula_no = #{formulaNo}</if>
  31. <if test="formulaParaNo != null ">and fp.formula_para_no = #{formulaParaNo}</if>
  32. <if test="formulaParaName != null and formulaParaName != ''">and fp.formula_para_name like concat(concat('%',
  33. #{formulaParaName}), '%')
  34. </if>
  35. <if test="formulaParaDesc != null and formulaParaDesc != ''">and fp.formula_para_desc = #{formulaParaDesc}
  36. </if>
  37. <if test="formulaParaType != null ">and fp.formula_para_type = #{formulaParaType}</if>
  38. <if test="formulaParaIsnormal != null ">and fp.formula_para_isnormal = #{formulaParaIsnormal}</if>
  39. <if test="formulaParaIslock != null ">and fp.formula_para_islock = #{formulaParaIslock}</if>
  40. <if test="formulaName != null and formulaName != ''">and f.formula_name like concat(concat('%',
  41. #{formulaName}), '%')
  42. </if>
  43. </where>
  44. </select>
  45. <select id="selectFormulaParaById" parameterType="Long" resultMap="FormulaParaResult">
  46. <include refid="selectFormulaParaVo"/>
  47. where formula_no = #{formulaNo}
  48. </select>
  49. </mapper>