| | |
| | | |
| | | <select id="selectLinkAll" resultType="java.util.Map"> |
| | | SELECT d.id, |
| | | l.entrust_coding entrustCoding, |
| | | DATE_FORMAT(l.`inspection_time`, '%Y-%m-%d') formTime, |
| | | l.`entrusted` supplier, |
| | | d.`sample_number` mcode, |
| | | d.`sample_name` name, |
| | | d.`specifications_models` specifications, |
| | | d.`spe_name` specifications, |
| | | d.`unit`, |
| | | d.`samples_number` num, |
| | | d.specifications_models specificationsId, |
| | |
| | | where state = 1 |
| | | and type = #{type} |
| | | order by create_time desc |
| | | limit #{num1}, #{num2} |
| | | limit #{num1}, #{num2} |
| | | </select> |
| | | <select id="selectMaterialById" resultType="Map"> |
| | | select m.id, |
| | |
| | | </resultMap> |
| | | |
| | | <select id="FourTree" resultMap="OneLevelTreeMap"> |
| | | SELECT m.`type`, m.`id` materialId, m.`name` materialName, s.id standardId, s.name standardName, |
| | | f.id specificationsId, f.name specificationsName |
| | | SELECT m.`type`, |
| | | m.`id` materialId, |
| | | m.`name` materialName, |
| | | s.id standardId, |
| | | s.name standardName, |
| | | f.id specificationsId, |
| | | f.name specificationsName |
| | | FROM material m |
| | | LEFT JOIN (SELECT s.`id`, s.`name`, s.`material_id` FROM standard s WHERE s.`state` = 1) s |
| | | ON s.material_id = m.`id` |
| | | LEFT JOIN (SELECT f.`id`, f.`name`, f.`standard_id`, f.`create_time` FROM specifications f WHERE f.`state` = 1) f |
| | | LEFT JOIN (SELECT f.`id`, f.`name`, f.`standard_id`, f.`create_time` |
| | | FROM specifications f |
| | | WHERE f.`state` = 1) f |
| | | ON f.standard_id = s.id |
| | | WHERE m.`state` = 1 |
| | | ORDER BY f.create_time DESC |
| | | </select> |
| | | |
| | | <select id="getTreeByMaterialId" resultMap="getTreeById"> |
| | | SELECT |
| | | m.id mId, |
| | | m.`name` mName, |
| | | sd.id sdId, |
| | | sd.`name` sdName, |
| | | ss.id ssId, |
| | | ss.`name` ssName |
| | | FROM |
| | | material m, |
| | | standard sd, |
| | | specifications ss |
| | | WHERE |
| | | m.id = sd.material_id |
| | | SELECT m.id mId, |
| | | m.`name` mName, |
| | | sd.id sdId, |
| | | sd.`name` sdName, |
| | | ss.id ssId, |
| | | ss.`name` ssName |
| | | FROM material m, |
| | | standard sd, |
| | | specifications ss |
| | | WHERE m.id = sd.material_id |
| | | AND sd.id = ss.standard_id |
| | | AND m.id = #{id} |
| | | AND m.state != 0 |
| | | AND sd.state != 0 |
| | | AND ss.state !=0 |
| | | </select> |
| | | <resultMap id="getTreeById" type="map"> |
| | | <result property="id" column="mId"/> |
| | | <result property="name" column="mName"/> |
| | | <collection property="children" resultMap="getStan" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="getTreeById" type="map"> |
| | | <result property="id" column="mId"/> |
| | | <result property="name" column="mName"/> |
| | | <collection property="children" resultMap="getStan" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="getStan" type="map"> |
| | | <result property="id" column="sdId"/> |
| | | <result property="name" column="sdName"/> |
| | |
| | | # redis访问密码(默认为空) |
| | | password: null |
| | | # redis连接超时时间(单位毫秒) |
| | | timeout: 2000 |
| | | timeout: 20 |
| | | # redis连接池配置 |
| | | pool: |
| | | # 最大可用连接数(默认为8,负数表示无限) |