123dbb81
徐泉
研学代码提交
|
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
|
<select id="getList" parameterType="com.sincere.student.dto.ConsultSearchDto" resultMap="ListMap">
select DISTINCT c.id , c.column_type , info.id as universityId ,c.read_number , c.img_url ,c.sort , info.name ,
info.code ,c.status
,c.background from university_consult c
join university_info info on c.university_id = info.id
left join university_relate_major r on info.id = r.university_id
left join university_major m on m.id = r.major_id
<where>
<if test="columnType > 0">
and c.column_type = #{columnType}
</if>
<if test="columnType == 0">
and c.column_type = (select top 1 id from university_column_type where type = 2 order by sort)
</if>
<if test="columnType == -1">
and 1=1
</if>
<if test="province != null and province != '' ">
and info.province = #{province}
</if>
<if test="city != null and city != '' ">
and info.city = #{city}
</if>
<if test="universityName != null and universityName != ''">
and info.name like #{universityName}
</if>
<if test="majorName != null and majorName != ''">
and m.major like #{majorName}
</if>
<if test="status == 1">
and c.status = 1
</if>
<if test="status != 1">
and 1 = 1
</if>
</where>
order by c.sort
</select>
|
123dbb81
徐泉
研学代码提交
|
107
108
109
110
111
112
113
114
|
<select id="getColumnList" parameterType="java.lang.Integer" resultMap="ListMap">
select DISTINCT c.id , info.id as universityId , c.img_url ,c.read_number ,c.sort , info.name , info.code
,university_column_type.name as columnTypeString from university_consult c
join university_info info on c.university_id = info.id
left join university_column_type on c.column_type = university_column_type.id
where c.column_type = #{columnType} and c.status = 1
order by c.sort
</select>
|
123dbb81
徐泉
研学代码提交
|
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
<update id="updateRead" parameterType="java.lang.Integer">
update university_consult set read_number = read_number+1 where id=#{id}
</update>
<update id="updateSort" parameterType="com.sincere.student.model.Consult">
update university_consult set sort = #{sort} where id=#{id}
</update>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from university_consult
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.sincere.student.model.UniversityConsult" useGeneratedKeys="true"
keyProperty="id">
insert into university_consult (university_id, column_type,
video_url, context, img_url,create_time, sort,status,read_number,background,model_list)
values (#{universityId,jdbcType=INTEGER}, #{columnType,jdbcType=INTEGER},
#{videoUrl,jdbcType=VARCHAR}, #{context,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR},
GETDATE(),
#{sort,jdbcType=INTEGER},#{status},#{readNumber},#{background,jdbcType=VARCHAR},#{modelList,jdbcType=VARCHAR})
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sincere.student.model.UniversityConsult">
update university_consult
<set>
<if test="universityId != null">
university_id = #{universityId,jdbcType=INTEGER},
</if>
<if test="columnType != null">
column_type = #{columnType,jdbcType=INTEGER},
</if>
<if test="videoUrl != null">
video_url = #{videoUrl,jdbcType=VARCHAR},
</if>
<if test="context != null">
context = #{context,jdbcType=VARCHAR},
</if>
<if test="imgUrl != null">
img_url = #{imgUrl,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="readNumber != 0">
read_number = #{readNumber},
</if>
<if test="background != null">
background = #{background},
</if>
<if test="readNumber != 0">
model_list = #{modelList}
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
|