张磊磊
2023-10-30 84b684918a5533b444d770342faa9bacbd8349ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.thhy.materials.modules.biz.pipeplan.mapper.TPipeInfoMapper">
  <resultMap id="BaseResultMap" type="com.thhy.materials.modules.biz.pipeplan.entity.TPipeInfo">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed May 10 18:27:25 CST 2023.
    -->
    <id column="pipe_id" jdbcType="VARCHAR" property="pipeId" />
    <result column="ring_num" jdbcType="VARCHAR" property="ringNum" />
    <result column="pipe_num" jdbcType="VARCHAR" property="pipeNum" />
    <result column="turn" jdbcType="VARCHAR" property="turn" />
    <result column="size" jdbcType="VARCHAR" property="size" />
    <result column="reinforcement" jdbcType="VARCHAR" property="reinforcement" />
    <result column="grouting_holes" jdbcType="VARCHAR" property="groutingHoles" />
    <result column="block_num" jdbcType="VARCHAR" property="blockNum" />
    <result column="produce_number" jdbcType="VARCHAR" property="produceNumber" />
    <result column="mod_id" jdbcType="VARCHAR" property="modId" />
    <result column="pouring_time" jdbcType="TIMESTAMP" property="pouringTime" />
    <result column="into_mod_time" jdbcType="TIMESTAMP" property="intoModTime" />
    <result column="check_user" jdbcType="VARCHAR" property="checkUser" />
    <result column="check_time" jdbcType="TIMESTAMP" property="checkTime" />
    <result column="pro_id" jdbcType="VARCHAR" property="proId" />
    <result column="into_mod_user" jdbcType="VARCHAR" property="intoModUser" />
    <result column="check_result" jdbcType="INTEGER" property="checkResult" />
  </resultMap>
 
  <select id="printPlanList"  resultType="com.thhy.materials.modules.biz.pipeplan.entity.TPipeInfo">
    SELECT
    tpi.pro_id AS proId,
    tpi.ring_num AS ringNum,
    tpi.pipe_num AS pipeNum,
    sp.pro_name AS proName,
    sd.dict_name AS sizeName,
    sd1.dict_name AS groutingName,
    sd2.dict_name as reinforcementName,
    sd3.dict_name as turnName,
    sd4.dict_name as blockNumName,
    tpi.into_mod_time as  intoModTime,
    tpi.pouring_time as  pouringTime,
    sm.mould_num as mouldNum,
    tpi.pipe_id as pipeId
FROM
    t_pipe_info tpi
    LEFT JOIN sys_project sp ON tpi.pro_id = sp.pro_id
    LEFT JOIN sys_dict sd ON tpi.size = sd.dict_id
    LEFT JOIN sys_dict sd1 ON tpi.grouting_holes = sd1.dict_id
    LEFT JOIN sys_dict sd2 ON tpi.reinforcement = sd2.dict_id
    LEFT JOIN sys_dict sd3 ON tpi.turn = sd3.dict_id
    LEFT JOIN sys_dict sd4 ON tpi.block_num = sd4.dict_id
    left join sys_mould sm on tpi.mod_id=sm.mould_id
    where 1=1
    <if test="proId!=null and proId!='' ">
        and sp.pro_id=#{proId}
    </if>
    <if test="companyId!=null and companyId!='' ">
        and sp.company_id=#{companyId}
    </if>
    <if test="newTime!=null and newTime!='' ">
        and tpi.into_mod_time like concat('%',#{newTime},'%')
    </if>
    <if test="ringNum!=null and ringNum!='' ">
        and tpi.ring_num like concat('%',#{ringNum},'%')
    </if>
    order by tpi.into_mod_time desc
  </select>
  <insert id="pipeRecordInsert">
    insert into t_pipe_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="pipeId != null">
        pipe_id,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="pipeId != null">
        #{pipeId,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="printRecordList" resultType="com.thhy.materials.modules.biz.pipeplan.entity.TPipeInfo">
    SELECT
    tpi.pro_id AS proId,
    tpi.ring_num AS ringNum,
    tpi.pipe_num AS pipeNum,
    sp.pro_name AS proName,
    sd.dict_name AS sizeName,
    sd1.dict_name AS groutingName,
    sd2.dict_name     as reinforcementName,
    sd3.dict_name as turnName,
    sd4.dict_name as blockNumName,
    tpi.into_mod_time as  intoModTime,
    tpi.pouring_time as  pouringTime,
    sm.mould_num as mouldNum,
    tpc.create_time as createTime
    FROM
    t_pipe_record tpc LEFT JOIN
    t_pipe_info tpi ON tpc.pipe_id=tpi.pipe_id
    LEFT JOIN sys_project sp ON tpi.pro_id = sp.pro_id
    LEFT JOIN sys_dict sd ON tpi.size = sd.dict_id
    LEFT JOIN sys_dict sd1 ON tpi.grouting_holes = sd1.dict_id
    LEFT JOIN sys_dict sd2 ON tpi.reinforcement = sd2.dict_id
    LEFT JOIN sys_dict sd3 ON tpi.turn = sd3.dict_id
    LEFT JOIN sys_dict sd4 ON tpi.block_num = sd4.dict_id
    left join sys_mould sm on tpi.mod_id=sm.mould_id
    where 1=1
    <if test="proId!=null and proId!='' ">
      and sp.pro_id=#{proId}
    </if>
    <if test="companyId!=null and companyId!='' ">
      and sp.company_id=#{companyId}
    </if>
    order by tpi.into_mod_time desc
  </select>
</mapper>